package com.xohm.cm.gui;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.JPanel;

public class ConnectPanel extends JPanel {
	private static final long serialVersionUID = 1L;
	
	public ConnectPanel() {
		setOpaque(false);
	}
	
	@Override
	protected void paintComponent(Graphics g) {
	    int x = 5;
	    int y = 2;
	    int w = getWidth() - 10;
	    int h = getHeight() - 4;
	    int arc = 20;

	    Graphics2D g2 = (Graphics2D) g.create();
	    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
	            RenderingHints.VALUE_ANTIALIAS_ON);
	    g2.setColor(Color.WHITE);
	    g2.fillRoundRect(x, y, w, h, arc, arc);
	    g2.setStroke(new BasicStroke(2f));
	    
	    g2.setColor(Color.decode(Properties.backgroundColor));
	    g2.drawRoundRect(x, y, w, h, arc, arc); 
	    g2.dispose();
	}
}
